/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * The software in this package is published under the terms of the GPL v2.0
 * license, a copy of which has been included with this distribution in the
 * LICENSE-GPL.txt file.
 */

package org.cemantika.management.drools;

import org.cemantika.exception.KnowledgeSessionAlreadyCreatedException;
import org.cemantika.exception.LoadKnowledgeSessionException;

/**
 * KnowledgeSessionLookup represents the creation of a persisted knowledge session.
 *
 * @author andersonfellipe
 */
public interface KnowledgeSessionLookup {

    /**
     * Creates a new knowledge session and returns its session id useful when the persistence is
     * active.
     * 
     * @return the sessionId the id of the session.
     */
    public int newKnowledgeSession() throws KnowledgeSessionAlreadyCreatedException;

    /**
     * Creates a new knowledge session retrieved from the database when the persistence is active.
     * 
     * @param sessionId the id of the session.
     */
    public void loadKnowledgeSession(int sessionId) throws LoadKnowledgeSessionException;
    
}
